package br.ceut.especializacao.poo.applet;

import java.awt.Rectangle;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.SwingUtilities;


/**
* This code was edited or generated using CloudGarden's Jigloo
* SWT/Swing GUI Builder, which is free for non-commercial
* use. If Jigloo is being used commercially (ie, by a corporation,
* company or business for any purpose whatever) then you
* should purchase a license for each developer using Jigloo.
* Please visit www.cloudgarden.com for details.
* Use of Jigloo implies acceptance of these licensing terms.
* A COMMERCIAL LICENSE HAS NOT BEEN PURCHASED FOR
* THIS MACHINE, SO JIGLOO OR THIS CODE CANNOT BE USED
* LEGALLY FOR ANY CORPORATE OR COMMERCIAL PURPOSE.
*/
public class AppletMain extends JFrame {
	
	{
		//Set Look & Feel
		try {
			javax.swing.UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
		} catch(Exception e) {
			e.printStackTrace();
		}
	}

	private JPanel jContentPane = null;

	private JButton jButtonLivro = null;
	private JButton jButtonFornecedor = null;
	private JButton jButton1;
	private JButton jButton2;
	private JLabel jBibliotecaVirtual;

	/**
	 * This method initializes jButtonLivro	
	 * 	
	 * @return javax.swing.JButton	
	 */
	private JButton getJButtonLivro() {
		if (jButtonLivro == null) {
			jButtonLivro = new JButton();
			jButtonLivro.setBounds(41, 114, 158, 41);
			jButtonLivro.setText("Gerencia livros");
			jButtonLivro.addActionListener(new java.awt.event.ActionListener() {
				public void actionPerformed(java.awt.event.ActionEvent e) {
					AppletLivro livro = new AppletLivro();
					livro.show();
				}
			});
		}
		return jButtonLivro;
	}
	
	/**
	 * This method initializes jButtonLivro	
	 * 	
	 * @return javax.swing.JButton	
	 */
	private JButton getJButtonFornecedor() {
		if (jButtonFornecedor == null) {
			jButtonFornecedor = new JButton();
			jButtonFornecedor.setBounds(238, 184, 173, 41);
			jButtonFornecedor.setText("Gerencia fornecedores");
			jButtonFornecedor.addActionListener(new java.awt.event.ActionListener() {
				public void actionPerformed(java.awt.event.ActionEvent e) {
					AppletFornecedor fornecedor = new AppletFornecedor();
					fornecedor.show();
				}
			});
		}
		return jButtonFornecedor;
	}

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		SwingUtilities.invokeLater(new Runnable() {
			public void run() {
				AppletMain thisClass = new AppletMain();
				thisClass.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
				thisClass.setVisible(true);
			}
		});
	}

	/**
	 * This is the default constructor
	 */
	public AppletMain() {
		super();
		initialize();
	}

	/**
	 * This method initializes this
	 * 
	 * @return void
	 */
	private void initialize() {
		this.setSize(466, 329);
		this.setTitle("JFrame");
		this.setContentPane(getJContentPane());
	}

	/**
	 * This method initializes jContentPane
	 * 
	 * @return javax.swing.JPanel
	 */
	private JPanel getJContentPane() {
		if (jContentPane == null) {
			jContentPane = new JPanel();
			jContentPane.setLayout(null);
			jContentPane.setPreferredSize(new java.awt.Dimension(440, 269));
			jContentPane.add(getJButtonLivro(), null);
			jContentPane.add(getJButtonFornecedor(), null);
			jContentPane.add(getJBibliotecaVirtual());
			jContentPane.add(getJButton1());
			jContentPane.add(getJButton2());
		}
		return jContentPane;
	}
	
	private JLabel getJBibliotecaVirtual() {
		if(jBibliotecaVirtual == null) {
			jBibliotecaVirtual = new JLabel();
			jBibliotecaVirtual.setText("Biblioteca Virtual");
			jBibliotecaVirtual.setBounds(114, 22, 223, 47);
			jBibliotecaVirtual.setFont(new java.awt.Font("Segoe UI",0,26));
		}
		return jBibliotecaVirtual;
	}
	
	private JButton getJButton1() {
		if(jButton1 == null) {
			jButton1 = new JButton();
			jButton1.setText("Gerencia exemplares");
			jButton1.setBounds(238, 114, 173, 41);
			jButton1.addActionListener(new ActionListener() {
				public void actionPerformed(ActionEvent e) {
					AppletExemplar exemplar = new AppletExemplar();
					exemplar.show();
				}
			});
		}
		return jButton1;
	}
	
	private JButton getJButton2() {
		if(jButton2 == null) {
			jButton2 = new JButton();
			jButton2.setText("Gerencia autores");
			jButton2.setBounds(41, 184, 158, 41);
			jButton2.addActionListener(new ActionListener() {
				public void actionPerformed(ActionEvent e) {
					AppletAutor autor = new AppletAutor();
					autor.show();
				}
			});
		}
		return jButton2;
	}

}  //  @jve:decl-index=0:visual-constraint="10,10"
